﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="admin_Setting_Default" %>


<%@ Register TagName="TabMenu" TagPrefix="menu" Src="~/admin/Setting/Menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">


    <div class="content-box-outer">
        <div class="content-box-right">
            <menu:TabMenu ID="menu1" runat="server" />
        </div>
        <div class="content-box-left">
            <div class="info" style="float: right; width: 350px; position: relative; top: 35px">
                <h4>Cài đặt cơ bản</h4>
                <p>
                    Cho phép cài đặt các nội dung hiển thị trên website.
                </p>
                <p>
                    <img src="<%=Setting.String("SITE_LOGO") %>" alt="" id="imgthumb" width="355" height="95" />
                </p>
                <p>
                    <a href="http://tuanitpro.com">Dịch vụ thiết kế website</a>
                </p>
            </div>
            <h1>Cài đặt cơ bản</h1>
            <ul class="fl leftaligned">
                <li>
                    <label class="lbl">Tên website</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_NAME") %>" style="width: 300px" id="txtSiteName" onblur="$.dalatcooking.jsonSettingUpdate('SITE_NAME', this.value);" />


                </li>
                <li>
                    <label class="lbl">Url</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_URL") %>" style="width: 300px" id="txtSiteUrl" onblur="$.dalatcooking.jsonSettingUpdate('SITE_URL', this.value);" /></li>
                <li>
                    <label class="lbl">
                        Logo</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_LOGO") %>" style="width: 300px" id="txtLogo" onblur="$.dalatcooking.jsonSettingUpdate('SITE_LOGO', this.value);" />
                    &nbsp;<a href="#" id="urlLogo">Url</a>
                </li>

                <li>
                    <label class="lbl">
                        Địa chỉ</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_ADDRESS") %>" style="width: 300px" onblur="$.dalatcooking.jsonSettingUpdate('SITE_ADDRESS', this.value);" />
                </li>
                <li>
                    <label class="lbl">
                        Điện thoại</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_PHONE") %>" style="width: 300px" id="txtPhone" onblur="$.dalatcooking.jsonSettingUpdate('SITE_PHONE', this.value);" />
                </li>
                <li>
                    <label class="lbl">
                        Email</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_EMAIL") %>" style="width: 300px" id="txtEmail" onblur="$.dalatcooking.jsonSettingUpdate('SITE_EMAIL', this.value);" />
                </li>
                <li>
                    <label class="lbl">
                        YM</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_YM") %>" style="width: 300px" id="txtYahoo" onblur="$.dalatcooking.jsonSettingUpdate('SITE_YM', this.value);" />
                </li>

                <li>
                    <label class="lbl">
                        Skype</label>
                    <input type="text" class="w300" value="<%=Setting.String("SITE_SKYPE") %>" style="width: 300px" id="txtSkype" onblur="$.dalatcooking.jsonSettingUpdate('SITE_SKYPE', this.value);" />
                </li>

                <li>
                    <label class="lbl" for="<%=ddlTheme.ClientID %>">
                        Theme</label>

                    <asp:DropDownList runat="Server" ID="ddlTheme" Style="text-transform: capitalize" AppendDataBoundItems="true" CssClass="w300" Width="300">
                    </asp:DropDownList>
                </li>
                <li>
                    <label class="lbl" for="<%=ddlCulture.ClientID %>">
                        Ngôn ngữ</label>
                    <asp:DropDownList runat="Server" ID="ddlCulture" Style="text-transform: capitalize">
                        <asp:ListItem Text="Auto" />
                        <asp:ListItem Text="Vietnamese" Value="vi-VN" />
                        <asp:ListItem Text="english" Value="en-US" />
                    </asp:DropDownList>
                </li>
                <li>
                    <label class="lbl" for="<%=txtTimeZone.ClientID %>">
                        Cài đặt giờ</label>
                    <asp:TextBox runat="Server" ID="txtTimeZone" Width="30" CssClass="number" />
                    <span>Server time:
                        <%=DateTime.Now.ToShortTimeString() %></span> </li>
                <li>
                    <label class="lbl" for="<%=txtPostsPerPage.ClientID %>">
                        Bản tin trên trang</label>
                    <asp:TextBox runat="server" ID="txtPostsPerPage" Width="50" MaxLength="4" CssClass="required number" />
                </li>
                <li>
                    <label class="lbl">
                        Giao diện</label>
                    <asp:CheckBox runat="server" ID="cbShowDescriptionInPostList" />
                    <label for="<%=cbShowDescriptionInPostList.ClientID %>">
                        Hiển thị mô tả</label>
                    <div class="insetForm" id="DescriptionCharacters" style="display: none;">
                        <label class="lbl" for="<%=txtDescriptionCharacters.ClientID %>">
                            Số ký tự mô tả</label>
                        <asp:TextBox runat="server" ID="txtDescriptionCharacters" Width="40" CssClass="number" />
                    </div>
                </li>
                <li><span class="filler"></span>
                    <asp:CheckBox runat="server" ID="cbShowDescriptionInPostListForPostsByTagOrCategory" />
                    <label for="<%=cbShowDescriptionInPostListForPostsByTagOrCategory.ClientID %>">
                        Hiển thị mô tả theo tag, chuyên mục</label>
                    <div class="insetForm" id="DescriptionCharactersForPostsByTagOrCategory" style="display: none;">
                        <label class="lbl" for="<%=txtDescriptionCharactersForPostsByTagOrCategory.ClientID %>">
                            Số ký tự</label>
                        <asp:TextBox runat="server" ID="txtDescriptionCharactersForPostsByTagOrCategory"
                            Width="40" CssClass="number" />
                    </div>
                </li>
                <li><span class="filler"></span>
                    <asp:CheckBox runat="server" ID="cbShowRelatedPosts" />
                    <label for="<%=cbShowRelatedPosts.ClientID %>">
                        Hiển thị tin liên quan</label>
                </li>
                <li><span class="filler"></span>
                    <asp:CheckBox runat="server" ID="cbShowPostNavigation" />
                    <label for="<%=cbShowPostNavigation.ClientID %>">
                        Hiển thị phân trang</label>
                </li>
                <li>
                    <label class="lbl">
                        Cài đặt khác</label>
                    <asp:CheckBox runat="server" ID="cbUseBlogNameInPageTitles" />
                    <label for="<%=cbUseBlogNameInPageTitles.ClientID %>">
                        Hiển thị tên website trên tiêu đề tin</label>
                    <span class="insetHelp">(Hiển tên website trên tiêu đề)</span> </li>
                <li><span class="filler"></span>
                    <asp:CheckBox runat="server" ID="cbEnableRating" />
                    <label for="<%=cbEnableRating.ClientID %>">
                        Đánh giá</label>
                </li>
                <li><span class="filler"></span>
                    <asp:CheckBox runat="server" ID="cbTimeStampPostLinks" />
                    <label for="<%=cbTimeStampPostLinks.ClientID %>">
                        Thời gian gửi bài</label>
                </li>
                <li><span class="filler"></span>
                    <asp:CheckBox runat="server" ID="cbEnablePasswordReset" />
                    <label for="<%=cbEnablePasswordReset.ClientID %>">
                        Mật mã bí mật</label>
                </li>
                <li><span class="filler"></span>
                    <asp:CheckBox runat="server" ID="cbEnableSelfRegistration" />
                    <label for="<%=cbEnableSelfRegistration.ClientID %>">
                        Cho phép tự đăng ký</label>
                </li>
                <li>
                    <label class="lbl" for="<%=ddlSelfRegistrationInitialRole.ClientID %>">
                        Quyền</label>
                    <asp:DropDownList runat="Server" ID="ddlSelfRegistrationInitialRole" Style="text-transform: capitalize">
                        <asp:ListItem Text="Select" />
                    </asp:DropDownList>
                </li>
            </ul>
            <div class="action_buttons">
                <!--
                <input type="submit" id="btnSave" class="btn primary" value="Lưu" />
                -->
                <input type="button" value="Lưu" id="btnSave" class="btn primary"
                    onclick="return SaveBasicSettings();" />
                <img class="loader2" src="/admin/images/ajax-loader.gif" alt="loader" />
            </div>
        </div>
    </div>

    <script type="text/javascript">
        jQuery(document).ready(function () {

            var url = jQuery("a#urlLogo");
            var txtPicture = jQuery("#txtLogo");
            var thumb = jQuery("img#imgthumb");
            new AjaxUpload(url, {

                action: '/ImageUpload.axd',
                name: 'myFile',
                onSubmit: function (file, extension) {
                    if (!(extension && /^(jpg|png|jpeg|gif|bmp|JPG|PNG|JPEG|BMP|GIF)$/.test(extension))) {

                        alert('Only JPG, PNG or GIF files are allowed');
                        return false;
                    }
                    thumb.attr('src', '/uploads/images/bigloading.gif');

                    txtPicture.val('Loading...');
                    txtPicture.attr('disabled', true);
                    this.disable();

                },
                onComplete: function (file, response) {
                    thumb.load(function () {

                        thumb.unbind();

                    });
                    txtPicture.attr('disabled', false);
                    var resp = response;
                    resp = $(resp).html();
                    thumb.attr('src', resp);
                    this.enable();
                    txtPicture.val(resp);
                    $.dalatcooking.jsonSettingUpdate('SITE_LOGO', resp);
                }
            });
        });
    </script>

</asp:Content>

